#include "SigmoidLayer.h"
#include <math.h>
#include "../Initializers/NguyenWidrowFunction.h"

using namespace NeuralPlusPlus::Core;
using namespace NeuralPlusPlus::Core::Backpropagation;
using namespace NeuralPlusPlus::Core::Initializers;

double NeuralPlusPlus::Core::Backpropagation::SigmoidLayer::Derivative( double input, double output )
	{
	return output * (1 - output);
	}

double NeuralPlusPlus::Core::Backpropagation::SigmoidLayer::Activate( double input, double previousOutput )
	{
	return 1 / (1 + exp(-input));
	}

NeuralPlusPlus::Core::Backpropagation::SigmoidLayer::SigmoidLayer( int neuronCount ) : ActivationLayer(neuronCount)
	{
	this->Initializer = new NguyenWidrowFunction();
	}